package DomainLayer;

import Annotations.ProcessNameAnnotation;

@ProcessNameAnnotation(Name="RatingChangeProcess")
public class RatingChangeProcess extends AbstractProcess {

    private IRatingSupportable obj;
    private int change;

    public void setChange(int change) {
		this.change = change;
	}

    public int getChange() {
        return change;
    }

	public IRatingSupportable getObject() {
		return obj;
	}

	public void setObject(IRatingSupportable obj) {
        this.obj = obj;
	}

    @Override
	public void process() {
		super.process();
		setStatus(ProcessStatus.InProcess);
		getObject().setRating(getObject().getRating() + getChange());
		setStatus(ProcessStatus.Completed);
	}
}
